package com.sjgtw.cloud.system.api.service;

import com.sjgtw.cloud.common.core.constant.ServiceNameConstants;
import com.sjgtw.cloud.common.core.domain.R;
import com.sjgtw.cloud.system.api.domain.SysFile;
import com.sjgtw.cloud.system.api.fallbackfactory.RemoteFileFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>Title: 文件服务API</p>
 * <p>Description: </p>
 * @author Admin
 * @date 2021-4-7
 */
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteFileService
{
	/**
	 *  文件上传
	 *
	 * @param file 文件信息
	 * @return 结果
	 */
	@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);


}
